#pragma once

enum JOYNUM {JN_JOYSTICK0=0, JN_JOYSTICK1};

extern DWORD      joytype[2];

void    JoyInitialize();
void    JoyReset();
BOOL    JoySetEmulationType(DWORD,int);
void    JoySetPosition(int,int,int,int);
void    JoyUpdatePosition();
DWORD   JoyGetSnapshot(SS_IO_Joystick* pSS);
DWORD   JoySetSnapshot(SS_IO_Joystick* pSS);
void    CASetJoystick0(int,int,int,int);

BYTE JoyReadButton(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nCyclesLeft);
BYTE JoyReadPosition(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nCyclesLeft);
BYTE JoyResetPosition(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nCyclesLeft);
